An electronic device can include an input surface to receive a force input from a user. A sensor coupled to the input surface can be configured to generate a signal corresponding to a deformation of the input surface that results from the force input. The signal can be used by the electronic device to determine an operation to perform in response to the force input.
The performance of the sensor may be affected by the precision with which the deformation of the input surface is detected. In many cases, the sensor includes a strain-sensitive element coupled to the input surface to measure strain experienced by the input surface as a result of the deformation. However, in some cases, a measurement obtained from the strain-sensitive element is affected by interference caused by changing magnetic fields, which may originate at components such as speakers, haptic feedback elements, inductive power transfer interfaces, microphones, styluses, and so on.